package com.example.weathermvvm.ui.area

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.example.weathermvvm.data.PlaceRepository

/**
 *
 * @Author： LJH
 * @Time： 2022/8/10
 * @description：viewModel工厂类，通过该类创建ChooseAreaViewModel实例
 */
class ChooseAreaModelFactory(private val repository: PlaceRepository):ViewModelProvider.NewInstanceFactory() {

    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        return ChooseAreaViewModel(repository) as T
    }
}